<template>
  <view class="box">
    <!-- 店铺头图 -->
    <image class="logo" :src="shopLogo" mode="aspectFill" />
    <text class="tit">进入店铺查看更多</text>
    <button class="btn" @tap="goUserEnd">立即进店</button>
  </view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app'
import{ref} from 'vue';

/* -------------------- 页面参数 -------------------- */
const shopId = ref('')
const targetAppId = ref('')       

/* -------------------- 生命周期 -------------------- */
onLoad((query) => {
  shopId.value = query.shopId
})

/* -------------------- 跳转函数 -------------------- */
function goUserEnd() {
  uni.navigateToMiniProgram({
    appId : 'wxffc65586a5e155ed',
    path: '/pages/shop/shop',
    envVersion: 'trial',   // 体验版换 trial
    success() {
      // 延迟返回，避免闪屏
      setTimeout(() => uni.navigateBack(), 500)
    },
    fail(err) {
      uni.showToast({ title: '已取消跳转', icon: 'none' })
      console.error(err)
    }
  })
}
</script>

<style scoped>
.box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120rpx 60rpx;
  background: #fff;
  min-height: 100vh;
}
.logo {
  width: 160rpx;
  height: 160rpx;
  border-radius: 16rpx;
  margin-bottom: 40rpx;
}
.tit {
  font-size: 32rpx;
  color: #333;
  margin-bottom: 80rpx;
}
.btn {
  width: 400rpx;
  height: 88rpx;
  line-height: 88rpx;
  background: #07c160;
  color: #fff;
  border-radius: 12rpx;
  font-size: 32rpx;
}
</style>